Skip to content

Introduce Judge model#1146

Merged
littleforest merged 1 commit into
rubyforgood:mainfrom
khiga8:kh-judge_names
Oct 25, 2020
Merged

Introduce Judge model#1146
littleforest merged 1 commit into
rubyforgood:mainfrom
khiga8:kh-judge_names

Conversation

@khiga8

@khiga8 khiga8 commented Oct 21, 2020

Copy link
Copy Markdown
Collaborator

What github issue is this PR for, if any?

Resolves #929

What changed, and why?

  • introduces a new Judge model which belongs to a casa_org.
  • allows a new judge to be added per organization
  • allows existing judge to be edited
  • allows active status to be set per judge

How is this tested? (please write tests!) 💖💪

  • ensures that new judge can be added to org.
  • ensures that judge exists on Edit organization page.

Screenshots please :)

Screen Shot 2020-10-20 at 7 44 54 PM

@github-actions github-actions Bot added ruby Touches Ruby code Tests! 🎉💖👏 labels Oct 21, 2020
@littleforest

Copy link
Copy Markdown
Collaborator

I'm a little late to suggest this, so totally fine to be overruled, but any chance that we could make the table called "judges" and have a "Judge" model?

@khiga8

khiga8 commented Oct 22, 2020

Copy link
Copy Markdown
Collaborator Author

I'm a little late to suggest this, so totally fine to be overruled, but any chance that we could make the table called "judges" and have a "Judge" model?

@littleforest
Sure. I will need a bit more time then!

@compwron

compwron commented Oct 23, 2020

Copy link
Copy Markdown
Collaborator

Thank you for putting in all this work! Hopefully we can finish it up this coming week. Feel free to ask any question anytime, here or in slack :)

@seanmarcia seanmarcia changed the base branch from master to main October 23, 2020 21:06
@khiga8 khiga8 force-pushed the kh-judge_names branch 3 times, most recently from 7d9a495 to 5b1aa35 Compare October 24, 2020 01:17
@khiga8 khiga8 changed the title Introduce JudgeName model Introduce Judge model Oct 24, 2020
@khiga8

khiga8 commented Oct 24, 2020

Copy link
Copy Markdown
Collaborator Author

Hi @compwron and @littleforest,

This is ready for review :-)

@littleforest littleforest left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@khiga8 thanks so much for making the change to the Judge model!

Could you also add some request specs? I think spec/requests/contact_type_spec.rb is a good example to follow. (Though please use the plural and call your file spec/requests/judges_spec.rb).

Comment thread spec/models/judge_spec.rb
Comment thread spec/factories/judges.rb Outdated
@littleforest

Copy link
Copy Markdown
Collaborator

Please also run bundle exec standardrb --fix to fix linting errors which is why Travis isn't passing.

Comment thread db/schema.rb Outdated
**What**
* introduces a new `Judge` model which belongs to a casa_org.
* allows a new judge to be added per organization
* allows existing judge to be edited
* allows `active` status to be set per judge

**How**
* ensures that new judge can be added to org.
* ensures that judge exists on Edit organization page.
* tests controller paths
Comment thread spec/factories/judges.rb
@@ -0,0 +1,7 @@
FactoryBot.define do
factory :judge do
casa_org { create(:casa_org) }

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine, but for future simplicity, you can just write it like:

FactoryBot.define do
  factory :judge do
    casa_org
    name { Faker::Name.name }
    active { true }
  end
end

And it will automatically create the casa_org association.

@littleforest littleforest left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 💯 👯‍♀️ @khiga8 thanks so much for your hard work on this! Looks great!

@littleforest littleforest merged commit cf58b85 into rubyforgood:main Oct 25, 2020
@compwron

Copy link
Copy Markdown
Collaborator

You are invited to the CASA asynchronous retrospective-and-futurespective! Please take a look at https://bit.ly/casaretro (no login required) and add at least one note! Even if it's just "I was here and you are cool" or "omg y'all why do you keep messaging me" we want to hear it. <3
Next week Wednesday 18 November @ 6pm Pacific time we will Zoom about the board and talk about themes and takeaways. (Zoom link in our calendar at http://bit.ly/casacal or slack #casa channel https://rubyforgood.herokuapp.com/ )
Please ESPECIALLY add lots of notes if you won't be able to make it on Wednesday to talk!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ruby Touches Ruby code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

admins can customize judge_names per casa_org

3 participants